package controlLayer;

import java.util.LinkedList;

import modelLayer.Product;
import dbLayer.DBProducts;
import dbLayer.IFDBProducts;

public class ProductCtr implements IFDBProducts {
	
	protected IFDBProducts dbProducts;
	
	public ProductCtr() {
		dbProducts = new DBProducts();
	}

	@Override
	public int insertProduct(Product product) throws Exception {
		return dbProducts.insertProduct(product);
	}

	@Override
	public int addProductsToStock(Product product, Product updateProduct) {
		return dbProducts.addProductsToStock(product, updateProduct);
	}

	@Override
	public LinkedList<Product> getAllProducts() throws Exception {
		return dbProducts.getAllProducts();
	}

	@Override
	public Product searchProduct(Product product) {
		return dbProducts.searchProduct(product);
	}

	@Override
	public int updateProduct(Product product, Product updateProduct)
			throws Exception {
		return dbProducts.updateProduct(product, updateProduct);
	}

	@Override
	public int deleteProduct(Product product) throws Exception {
		return dbProducts.deleteProduct(product);
	}

	@Override
	public LinkedList<Product> getAllProducts(Product product) throws Exception {
		return dbProducts.getAllProducts(product);
	}

}
